package com.zixi.ai.framework.dao.spec;

import jakarta.persistence.criteria.CriteriaBuilder;
import jakarta.persistence.criteria.CriteriaQuery;
import jakarta.persistence.criteria.Predicate;
import jakarta.persistence.criteria.Root;

/**
 * @author mqiqe
 */
public interface Criterion {
    enum Operator {
        EQ, NE, LIKE, NLIKE, LIKE_CUSTOM, GT, LT, GTE, LTE, AND, OR, ISNULL, ISNOTNULL, ISEMPTY, ISNOTEMPTY, FUN_YEAR, FUN_MONTH
    }

    Predicate toPredicate(Root<?> root, CriteriaQuery<?> query,
                          CriteriaBuilder builder);
}  